package tr.edu.yildiz.ce.app_manager.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tr.edu.yildiz.ce.app_manager.dao.BasicDao;
import tr.edu.yildiz.ce.app_manager.dao.ProxyDao;
import tr.edu.yildiz.ce.app_manager.model.AppProxy;
import tr.edu.yildiz.ce.app_manager.model.BasicObject;
import tr.edu.yildiz.ce.app_manager.service.AppProxyService;
import tr.edu.yildiz.ce.app_manager.service.BasicService;

public class BasicServiceImpl<T extends BasicObject,ID> implements BasicService<T, ID>{

	BasicDao<T, ID> dao;
	
	public BasicServiceImpl(BasicDao<T, ID> dao) {
		this.dao = dao;
	}
	
	@Override
	public List<T> listAll() {
		return dao.listAll();
	}

	@Override
	public T get(ID id) {
		return dao.get(id);
	}

	@Override
	public T persist(T t) {
		dao.persist(t);
		return t;
	}

	@Override
	public void remove(T t) {
		dao.remove(t);
	}
	
	public BasicDao<T, ID> getDao() {
		return dao;
	}
	

}
